package com.lckj.android.shell.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.lckj.android.shell.App;

/**
 * @author lc. 2023-10-22 15:23
 */
public class PreferencesUtils {

    private static final String FILE_NAME = "app_cache.pre";

    public static String getLastUrl() {
        return getPreference().getString("pre.last_url", "");
    }

    public static void setLastUrl(String url) {
        getPreference().edit().putString("pre.last_url", url).apply();
    }

    private static SharedPreferences getPreference() {
        return App.getInstance().getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
    }
}
